import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import IndexNav from './components/IndexNav.vue'
import tabbar from './components/tabbar.vue'
import wback from './components/wback.vue'
import back from './components/back.vue'
import scrcletop from './components/scrcletop.vue'
import producetop from './components/producetop.vue'

// MD5加密
import md5 from 'js-md5';
Vue.prototype.$md5 = md5


// 百度地图
import BaiduMap from 'vue-baidu-map'
Vue.use(BaiduMap,{ak:'Lmf3i5jeETymQlrCl7jm4br09APPFFzR'})

// 引入移动端自适应
import 'lib-flexible'
Vue.config.productionTip = false
// 路由切换自动回到顶部
router.beforeEach((to, from, next) => {
  // chrome
  document.body.scrollTop = 0
  // firefox
  document.documentElement.scrollTop = 0
  // safari
  window.pageYOffset = 0
  next()
});
// 注册公共组件
Vue.component("index-nav",IndexNav)
Vue.component("tabbar",tabbar)
Vue.component("wback",wback)
Vue.component("back",back)
Vue.component("scrcletop",scrcletop)
Vue.component("producetop",producetop)

// 安装配置MintUI
import MintUI from 'mint-ui';
import 'mint-ui/lib/style.css';
Vue.use(MintUI);
//安装配置axios
import axios from 'axios';
Vue.prototype.axios=axios;
// axios.defaults.baseURL="http://127.0.0.1:9090"
axios.defaults.baseURL="http://39.106.41.14:9090"

// 安装配置VantUI

import Vant from 'vant';
import 'vant/lib/index.css';
Vue.use(Vant);


new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
